package DesignMode.Decorator;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}8:39
 */
public class IOTest {
    public static void main(String[] args) throws IOException {
        /*
        * 1、InputStream是抽象类，类似之前的Drink
        * 2、FileInputStream是InputStream子类，类似我们前面的DeCaf,LCoffee
        * 3、FilterInputStream是InputStream子类，是Decorator
        * 4、DataInputStream是FilterInputStream子类，具体的装饰者，类似前面的Milk
        * 5、FilterInputStream类有protected volatile InputStream in;即包含被装饰者
        * */



        DataInputStream in = new DataInputStream(new FileInputStream("E:\\DataStructure\\src\\DesignMode\\Decorator\\LCoffee.java"));
        System.out.println(in.read());
        in.close();
    }
}
